import type { CascaderOption } from 'element-plus'

interface ISelectOption {
     label: string
     value: any
}

type ItemType =
     | 'input'
     | 'password'
     | 'select'
     | 'datepicker'
     | 'number'
     | 'textarea'
     | 'cascader'
     | 'confirmPassword'
     | 'Switch'
     | 'primary'
     | 'upload'
     | 'picker'
     | 'month'

export interface IFormItem {
     field: string
     type: ItemType
     label: string
     placeHolder?: string
     disabled?: boolean
     rules?: any[]
     visible?: boolean
     options?: ISelectOption[]
     cascader?: CascaderOption[]
     otherOption?: any
     defaultValue?: any
     isHidden?: boolean
     props?: any
     slotName?: any
     initValue?: any
     filterable?: boolean
     clearable?: boolean
}

export interface IForm {
     title?: string
     formItems?: IFormItem[]
     labelWidth?: string
     itemStyle: any
     colLayout: any
}
